package com.ashapo.example;

public class Example013OverLoading {

    public static void main(String[] args) {
        System.out.println(Adder.add(11, 11));
        System.out.println(Adder.add(12.3, 12.6));
    }
}

/**
 *  重载时注意类型提升问题：https://www.yiibai.com/java/method-overloading-in-java.html
 */
class Adder {

    /**
     * 测试重载
     * @param a
     * @param b
     * @return
     */
    static int add(int a, int b) {
        return a + b;
    }

    /**
     * 测试重载
     * @param a
     * @param b
     * @return
     */
    static double add(double a, double b) {
        return a + b;
    }
}
